<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
 <%@ taglib uri="/WEB-INF/tld/tag.tld" prefix="my" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" type="text/css" href="/three/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/three/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/three/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/three/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/three/static/h-ui.admin/css/style.css" />


<title>现金流水</title>
</head>
<body style="margin:5px;">
<script language="JavaScript" type="text/javascript">  
   var idTmr;  
        function  getExplorer() {
            var explorer = window.navigator.userAgent ;  
            //ie  
            if (explorer.indexOf("MSIE") >= 0) {  
                return 'ie';  
            }  
            //firefox  
            else if (explorer.indexOf("Firefox") >= 0) {  
                return 'Firefox';  
            }  
            //Chrome  
            else if(explorer.indexOf("Chrome") >= 0){  
                return 'Chrome';  
            }  
            //Opera  
            else if(explorer.indexOf("Opera") >= 0){  
                return 'Opera';  
            }  
            //Safari  
            else if(explorer.indexOf("Safari") >= 0){  
                return 'Safari';  
            }  
        }  
        function method5(tableid) {
            if(getExplorer()=='ie')  
            {  
                var curTbl = document.getElementById(tableid);  
                var oXL = new ActiveXObject("Excel.Application");  
                var oWB = oXL.Workbooks.Add();  
                var xlsheet = oWB.Worksheets(1);  
                var sel = document.body.createTextRange();  
                sel.moveToElementText(curTbl);  
                sel.select();  
                sel.execCommand("Copy");  
                xlsheet.Paste();  
                oXL.Visible = true;  

                try {  
                    var fname = oXL.Application.GetSaveAsFilename("Excel.xls", "Excel Spreadsheets (*.xls), *.xls");  
                } catch (e) {  
                    print("Nested catch caught " + e);  
                } finally {  
                    oWB.SaveAs(fname);  
                    oWB.Close(savechanges = false);  
                    oXL.Quit();  
                    oXL = null;  
                    idTmr = window.setInterval("Cleanup();", 1);  
                }  

            }  
            else  
            {  
                tableToExcel(tableid)  
            }  
        }  
        function Cleanup() {  
            window.clearInterval(idTmr);  
            CollectGarbage();  
        }  
        var tableToExcel = (function() {  
            var uri = 'data:application/vnd.ms-excel;base64,',  
                    template = '<html><head><meta charset="UTF-8"></head><body><table>{table}</table></body></html>',  
                    base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) },  
                    format = function(s, c) {  
                        return s.replace(/{(\w+)}/g,  
                                function(m, p) { return c[p]; }) }  
            return function(table, name) {  
                if (!table.nodeType) table = document.getElementById(table)  
                var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}  
                window.location.href = uri + base64(format(template, ctx))  
            }  
        })()  
    </script>
<div class="page-container">
<form action="/three/bcr/listbcr" method="post">
	<div class="text-c"> 
	订单编号：<input type="text" name="qorderId" id=""  style="width:150px" class="input-text">
	顾客编号：<input type="text" name="qcustomUserId" id=""  style="width:150px" class="input-text">
	顾客姓名：<input type="text" name="qcustomUserName" id=""  style="width:150px" class="input-text"><br>
	支付方式：<span class="select-box inline">
				<select name="qpayWay"  class="select" style="width:150px">
				<option value=""></option>
				<option value="1">微信</option>
				<option value="2">支付宝</option>
				</select>
			</span>
	分类：<span class="select-box inline">
		<select name="qrecordTypPpe"  class="select" style="width:150px">
		<option value=""></option>
		<option value="1">购买颜值</option>
		<option value="2">服务消费</option>
		<option value="3">兑换颜值</option>
		</select>
		</span>
	日期范围：
		<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })" id="logmin" class="input-text Wdate" style="width:120px;" name="qstartTime">
		-
		<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d' })" id="logmax" class="input-text Wdate" style="width:120px;" name="qendTime">
		
		<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
	</div>
	</form>
	<button type="button" class="btn btn-success" value="导出Excel" onclick="method5('tableExcel')"><i class="Hui-iconfont">&#xe665;</i>导出Excel</button>
	<table class="table table-border table-bordered table-bg table-hover table-sort" id="tableExcel">
		<thead>
			<tr class="text-c">
				<th width="70">流水号</th>
				<th width="70">订单编号</th>
				<th width="70">顾客账号</th>
				<th width="70">姓名</th>
				<th width="120">颜值数量
				</th>
				<th width="120">支付方式
				</th>
				<th width="120">实际消费金额</th>
				<th width="70">分类</th>
				<th width="120">支付时间</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${list }" var="bcr">
		<tr> 
		<td>${bcr.recordId }</td>
		<td>${bcr.orderId }</td>
		<td>${bcr.customUserId }</td>
		<td><my:getUserName customUserId="${bcr.customUserId }"></my:getUserName></td>
		<td>${bcr.beautyNum }</td>
		<td>
			<c:if test="${bcr.payWay=='1'}">
				微信
			</c:if>
			<c:if test="${bcr.payWay=='2'}">
				支付宝
			</c:if>
		</td>
		<td>${bcr.money }</td>
		<td>
			<c:if test="${bcr.recordType=='1' }">
				购买美妍币
			</c:if>
			<c:if test="${bcr.recordType=='2' }">
				购买套餐
			</c:if>
			<c:if test="${bcr.recordType=='3' }">
				使用消费
			</c:if>
			<c:if test="${bcr.recordType=='4' }">
				预约
			</c:if>
		</td>
		<td><f:formatDate value="${bcr.payTime }" pattern="yyyy-MM-dd"/></td>
		</tr>
		</c:forEach>
		</tbody>
	</table>
	<div id="pageNav" class="pageNav"></div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/three/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/three/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/three/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="/three/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/three/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="/three/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="/three/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"pading":false,
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8]}// 不参与排序的列
	]
});

/*查看日志*/
function system_log_show(){
	
}


</script>
</body>
</html>